/*
 * @FilePath: /src/keyboard/main.cpp
 * @Author: Wilson
 * @Descripttion: 
 * @Date: 2020-11-25 20:52:29
 * @LastEditors: Wilson
 * @LastEditTime: 2020-11-26 13:40:41
 */

#include <iostream>
#include "ros/ros.h"
#include "geometry_msgs/Twist.h"

int main(int argc, char *argv[])
{
    ros::init(argc, argv, "keyboard");
    ros::NodeHandle n;
    ros::Publisher pub = n.advertise<geometry_msgs::Twist>("/cmd_vel", 1000);

    geometry_msgs::Twist msg;
    msg.linear.y = 1;

    ros::Rate loop_rate(10);
    while (ros::ok())
    {
        usleep(100 * 1000);
        pub.publish(msg);
        
        ros::spinOnce();
        loop_rate.sleep();
    }

    return 0;
}